﻿using System;
using System.ComponentModel;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using SlamCms.Configuration;

namespace SlamCms.SharePoint.WebParts
{
	[ToolboxItemAttribute(false)]
	public class HomeRedirect : WebPart
	{
		protected override void OnLoad(EventArgs e)
		{
			base.OnLoad(e);
			//If page is being edited, do not redirect
			if (Page.Request.QueryString["PageView"] == null)
			{
				Page.Response.Redirect(ConfigurationManager.Environment.DefaultApplication.FrontEndUrl);
			}
		}
	}
}
